cmake_minimum_required(VERSION 3.0.0)

set(target lzm_rtt)

project(${target} VERSION 0.0.1)

# comfig compile
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")

set(CMAKE_C_FLAGS "-m32")
set(CMAKE_CXX_FLAGS "-m32")
set(CMAKE_EXE_LINKER_FLAGS "-m32")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-e,entry")

# src
set(src_lzm_rtt
	../../src/clock.c
	../../src/components.c
	../../src/device.c
	../../src/idle.c
	../../src/ipc.c
	../../src/irq.c
	../../src/kservice.c
	../../src/mem.c
	../../src/mempool.c
	../../src/object.c
	../../src/scheduler_up.c
	../../src/thread.c
	../../src/timer.c

	../../components/drivers/ipc/ringbuffer.c

	../../libcpu/sim/posix/cpu_port.c
	drivers/board.c

	app/app.c
)

add_executable(${target} ${src_lzm_rtt})

target_link_libraries(${target} PUBLIC pthread)
target_include_directories(${target} PUBLIC 
	.
	../../include
	../../components/drivers/include
	
	../../libcpu/sim/posix
	drivers/include
	app/include
)
